<?php


namespace App\Http\Controllers;

use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;

class rentlist extends Controller
{
    public function rentlist(Request $request)
    {
        $search = isset($_GET['search'])?$_GET['search']:'';
        $m = 1;
        $page=$request->get('page');
        $page = isset($page)?$page:1;
        $n = ($page-1) * $m;
        $house = Db::table('house') -> where('hsite','like','%'.$search.'%') -> skip($n) -> take($m) -> get();
        $count = Db::table('house') -> where('hsite','like','%'.$search.'%') -> count('hid');
        return view('rentlist', ['house'=>$house,'search'=>$search,'count'=>$count,'page'=>$page,'m'=>$m]);
    }

    public function bianli()
    {

    }
}
